package com.genoworks.gcconsole;

import java.util.Date;

public class GcEvent {

  private String source = null;

  private Date at = new Date();

  private boolean isFull = false;

  private boolean isFullSystem = false;

  private long youngGenPre = 0;
  private long youngGenPost = 0;
  private long youngGenLimit = 0;
  private long permGenPre = 0;
  private long permGenPost = 0;
  private long permGenLimit = 0;
  private long oldGenPre = 0;
  private long oldGenPost = 0;
  private long oldGenLimit = 0;
  private long heapPre = 0;
  private long heapPost = 0;
  private long heapLimit = 0;

  private double duration = 0.0D;

  @Override
  public String toString() {
    return "full="
        + isFull
        + ", fullSystem="
        + isFullSystem
        + ",youngPre="
        + youngGenPre
        + ",youngPost="
        + youngGenPost
        + ",youngLimit="
        + youngGenLimit
        + ",permPre="
        + permGenPre
        + ",permPost="
        + permGenPost
        + ",permLimit="
        + permGenLimit
        + ",oldPre="
        + oldGenPre
        + ",oldPost="
        + oldGenPost
        + ",oldLimit="
        + oldGenLimit
        + ",heapPre="
        + heapPre
        + ",heapPost="
        + heapPost
        + ",heapLimit="
        + heapLimit
        + ",duration="
        + duration
        + ",at="
        + at;
  }

  public boolean isFull() {
    return isFull;
  }

  public void setFull( boolean isFull ) {
    this.isFull = isFull;
  }

  public boolean isFullSystem() {
    return isFullSystem;
  }

  public void setFullSystem( boolean isFullSystem ) {
    this.isFullSystem = isFullSystem;
  }

  public long getYoungGenPre() {
    return youngGenPre;
  }

  public void setYoungGenPre( long youngGenPre ) {
    this.youngGenPre = youngGenPre;
  }

  public long getYoungGenPost() {
    return youngGenPost;
  }

  public void setYoungGenPost( long youngGenPost ) {
    this.youngGenPost = youngGenPost;
  }

  public long getYoungGenLimit() {
    return youngGenLimit;
  }

  public void setYoungGenLimit( long youngGenLimit ) {
    this.youngGenLimit = youngGenLimit;
  }

  public long getPermGenPre() {
    return permGenPre;
  }

  public void setPermGenPre( long permGenPre ) {
    this.permGenPre = permGenPre;
  }

  public long getPermGenPost() {
    return permGenPost;
  }

  public void setPermGenPost( long permGenPost ) {
    this.permGenPost = permGenPost;
  }

  public long getPermGenLimit() {
    return permGenLimit;
  }

  public void setPermGenLimit( long permGenLimit ) {
    this.permGenLimit = permGenLimit;
  }

  public long getOldGenPre() {
    return oldGenPre;
  }

  public void setOldGenPre( long oldGenPre ) {
    this.oldGenPre = oldGenPre;
  }

  public long getOldGenPost() {
    return oldGenPost;
  }

  public void setOldGenPost( long oldGenPost ) {
    this.oldGenPost = oldGenPost;
  }

  public long getOldGenLimit() {
    return oldGenLimit;
  }

  public void setOldGenLimit( long oldGenLimit ) {
    this.oldGenLimit = oldGenLimit;
  }

  public long getHeapPre() {
    return heapPre;
  }

  public void setHeapPre( long heapPre ) {
    this.heapPre = heapPre;
  }

  public long getHeapPost() {
    return heapPost;
  }

  public void setHeapPost( long heapPost ) {
    this.heapPost = heapPost;
  }

  public long getHeapLimit() {
    return heapLimit;
  }

  public void setHeapLimit( long heapLimit ) {
    this.heapLimit = heapLimit;
  }

  public double getDuration() {
    return duration;
  }

  public void setDuration( double duration ) {
    this.duration = duration;
  }

  public String getSource() {
    return source;
  }

  public void setSource( String source ) {
    this.source = source;
  }

  public Date getAt() {
    return at;
  }

  public void setAt( Date at ) {
    this.at = at;
  }

  public long getMax() {
    return Math.max( Math.max( Math.max( youngGenLimit, oldGenLimit ), permGenLimit ), heapLimit );
  }
}
